package com.railway.dao;

import java.util.Date;
import java.util.List;

import com.railway.bean.Carriage;
import com.railway.bean.Pass;
import com.railway.bean.Seat;
import com.railway.bean.Train;

public interface TrainDao {

	/**通过站名或城市名查询站id
	 * @param keyword
	 * @return
	 */
	List<Integer> selectStation(String keyword);
	
	/**通过站id查询列车id
	 * @return
	 */
	List<Train> selectTrainIdByStation(int station_id1,int station_id2,List<Date> date);
	
	int selectPass_id(int station_id,int train_id);
	
	/**通过id查询列车
	 * @param Train_id
	 * @return
	 */
	List<Train> selectTranById(int Train_id);
	
	/**根据id查询站
	 * @param station_id
	 * @return
	 */
	String selectStationById(int station_id);
	
	/**根据站查id
	 * @param stationn
	 * @return
	 */
	int selectStation_id(String station);
	
	/**查询车厢
	 * @param train_id
	 * @return
	 */
	List<Carriage> selectCarriage(int train_id);
	
	/**查询座位
	 * @param train_id
	 * @param camage_num
	 * @return
	 */
	List<Seat> selectSeat(int train_id,int camage_num);
	
	/**查询途径站点
	 * @param train_id
	 * @return
	 */
	List<Pass> selectPass(int train_id);
	
	/**查询列车的总数
	 * @return
	 */
	int selectTrainCount();
	
	/**添加列车
	 * @param train
	 * @return
	 */
	int insertTrain(Train train);
	
	/**添加车站
	 * @param camage
	 * @return
	 */
	int insertCarriage(Carriage Carriage);
	
	/**添加座位
	 * @param seat
	 * @return
	 */
	int insertSeat(Seat seat);
	
	/**添加经过的站
	 * @param pass
	 * @return
	 */
	int insertPass(Pass pass);
	
	/**删除列车
	 * @param train_id
	 * @return
	 */
	int deleteTrain(int train_id);
	
	/**删除车厢
	 * @param train_id
	 * @return
	 */
	int deleteCarriage(int train_id);
	
	/**删除列车途径站
	 * @param train_id
	 * @return
	 */
	int deletePass(int train_id);
	
	/**删除座位
	 * @param train_id
	 * @return
	 */
	int deleteSeat(int train_id);
	
	/**通过车次名查列车
	 * @param train_name
	 * @return
	 */
	List<Train> selectTrainByTrainName(String train_name);
	
	/**查询所有列车
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	List<Train> selectTrainAll(int pageNum, int pageSize);
	
	/**添加途径时间
	 * @param train_id
	 * @param starting_time
	 * @param terminal_time
	 * @return
	 */
	int insertPassTime(int train_id,String pass_time,int stading_time);
	
	/**添加列车发车时间
	 * @param train_id
	 * @param starting_time
	 * @param terminal_time
	 * @return
	 */
	int insertTrainTime(int train_id ,String starting_time,String terminal_time);
}
